import React from 'react';
import {SecurityUser} from "type/entity/SecurityUser";
import {fetchAddUser} from "storage/redux/async-action/userAsyncAction";
import FormEnhance, {InputNumber, InputRadio, InputText} from "common/form";


const UserAddComponent = () => {
    return (
            <FormEnhance<SecurityUser>
                title={"添加用户信息"}
                backupText={"用户列表"}
                requestAction={fetchAddUser}
                initialValues={{
                    gender: true,
                    age: 18
                }}
            >
                <InputText<SecurityUser> name={"username"} label={"用户名"} required={true}/>
                <InputText<SecurityUser> name={"password"} label={"用户密码"} required={true}/>
                <InputText<SecurityUser> name={"identity"} label={"用户身份"}></InputText>
                <InputNumber<SecurityUser> name={"age"} label={"用户年龄"} required={true}></InputNumber>
                <InputRadio<SecurityUser> name={"gender"} label={"用户性别"}></InputRadio>
            </FormEnhance>
    );
};

export default UserAddComponent;